<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@include file = "/shmged/jsp/com/shlcm/portal/main/head.jsp" %>
  
    <%@page import="shmged.com.shlcm.utils.CmShmgedType"%>
    <%@page import="wt.doc.WTDocument"%>
<%@page import="shmged.com.shlcm.utils.CmSettings"%>
<%@page import="wt.fc.ReferenceFactory"%>
<%

String oid = request.getParameter("oid").trim();
ReferenceFactory rf = new ReferenceFactory();
WTDocument doc = (WTDocument)rf.getReference(oid).getObject();
String title = doc.getName();
String number=doc.getNumber();
%>
<head>
<title>创建文档</title>
</head>
<body>
<center>
<div style="display:none" >
<div style="width: 560px;" id="<%=uuid %>browseCreateProjectDoc">
<div style="margin:10px 0;"></div>
		<div style="padding:10px 0 10px 60px">
<form method="post" enctype="multipart/form-data" id="<%=uuid %>amCreateProjectDoc" name="amCreateProjectDoc" >
   <input type="hidden" name="docFolderPath"  id="docFolderPath" value="AuthenticationEntryFoler" />
   <input type="hidden" name="docType" id="<%=uuid %>docType" value="wt.doc.WTDocument" />
  <table>
  	  <tr>
		<td >项目编号:</td>
		<td ><input class="easyui-validatebox" type="text" value="<%=number %>" name="ProjectNo" id="<%=uuid %>ProjectNo" data-options="required:true,missingMessage:'请输入项目进度编号！'" size="60"></input></td>
	 </tr>
  	  <tr>
      <td>主要内容</td>
      <td>
        <input  type="file" id="inp_primary1" name="inp_primary1"  size="45" onchange="setName1()"/>
      </td>
    </tr>
    <tr>
      <td style="width:100px">*名称</td>
      <td>
        <input class="easyui-validatebox" data-options="required:true" name="docName1" id="<%=uuid %>docName1" type="text" size="45" />
      </td>
    </tr>
    <tr>
      <td >说明</td>
      <td>
        <textarea name="desc1" id="<%=uuid %>desc1" cols="45" rows="5"></textarea>
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td align="center"><label>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitProjctDocForm()">提交</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm1()">清除</a>
      </label></td>
    </tr>
  </table>
</form>
</div>
</div>
</div>
</center>

<script type="text/javascript">

function setName1()
{
	var value=document.getElementById("<%=uuid%>inp_primary1").value;
	var docValue=value.substring(value.lastIndexOf("\\")+1,value.lastIndexOf(".")); 
	document.getElementById("<%=uuid%>docName1").value=docValue;
}

function submitProjctDocForm(){
	 var docName=document.getElementById("docName1").value;
	 if(docName==""||docName==null)
	 {
		 alert("名称不能为空");
		 return;
	}
		
	$('#<%=uuid%>amCreateProjectDoc').submit();
}


function initCreateQues1(){
	$("#<%=uuid%>amCreateProjectDoc").form({
		url:'<%=baseUrl%>shmged/jsp/com/shlcm/documents/jspCreateDocument1.jsp',
		onSubmit:function (){
		},
		success:function (data){
			//alert(data);
			if(data.indexOf("ERROR") != -1){
				$.messager.alert('提示',"创建失败");
			}else{
				$.messager.alert('提示','创建成功');
				$('#browseCreateProjectDoc').window('close');
				refeProjectSch();
			}
			hideProcessMsg("prince_process_ques");
		},
		onLoadError:function (){
			hideProcessMsg("prince_process_ques");
		}
	});
}





function clearForm(){
	$('#<%=uuid%>amCreateProjectDoc').form('clear');
}


function browseCreateProjectDoc(){
	  $('#<%=uuid%>browseCreateProjectDoc').window({
		     collapsible:false,
		     minimizable:false,
		     maximizable:false,
		     resizable:false,
		     title:"创建技术文档",
			 width:580,
		     modal:true,
		     onClose:function(){
		  	refeProject();
		  	 $('#<%=uuid%>browseCreateProjectDoc').window("destroy");
		     }
		 });
}

//initCreateQues1();
</script>
</body>

</html>


